package com.gitee.wsl.evaluator.token


/**
 * Lex token interface
 *
 * @author dennis
 *
 * @param <T>
</T> */
interface Token<T>  {
    enum class TokenType {
        String, Variable, Number, Char, Operator, Pattern, Delegate
    }

    fun <V> getMeta(name: String): V?

    fun getValue(env: Map<String, Any?>? = null): T

    fun withMeta(name: String, v: Any?): Token<T>?

    fun <V> getMeta(name: String, defaultVal: V?): V?

    val metaMap: MutableMap<String, Any?>?

    val type: TokenType

    val lexeme: String?

    val startIndex: Int

    val endIndex: Int

    val lineNo: Int
}
